﻿using System;
using System.Net;

namespace libProxy
{
    public class ProxyClientEventArgs : EventArgs
    {
        public byte[] Data{ get; set;}
    }

    public interface IProxyClient
    {
        /// <summary>
        /// Sends message to remote host and returns received output
        /// </summary>
        /// <param name="to">remote host address</param>
        /// <param name="message">data to send</param>
        /// <returns>returned data</returns>
        byte[] Send(IPAddress to, byte[] message);

        /// <summary>
        /// Connects to a remote host keeping connection in the object instance
        /// </summary>
        /// <param name="to">remote host address</param>
        void Connect(IPAddress to);

        /// <summary>
        /// Send message to the host connected with Connect method
        /// </summary>
        /// <param name="message">data</param>
        /// <seealso cref="Connect"/>
        void Send(byte[] message);

        /// <summary>
        /// Event rised when anything received on from the remote host
        /// </summary>
        event EventHandler<ProxyClientEventArgs> OnReceive;
    }
}